<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="HTTP RESTful Interface to the Cask Data Application Platform" name="description" />
<meta content="Copyright © 2018 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>Reports HTTP RESTful API</title>

    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../index.html" />
    <link rel="up" title="CDAP HTTP RESTful API v3" href="index.html" />
    <link rel="next" title="Security HTTP RESTful API" href="security.html" />
    <link rel="prev" title="Query HTTP RESTful API" href="query.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: reference-manual -->
<!-- theme_manual_highlight: reference -->
<!-- sidebar_title_link: Reference -->

  <div role="note" aria-label="manuals links"><h3>Reference</h3>
    <ul class="reference-page-menu">
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html"> Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../characters.html"> Supported Characters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cli-api.html"> Command Line Interface API</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html"> HTTP RESTful API</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="artifact.html">Artifact</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="dataset.html">Dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="lifecycle.html">Lifecycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="metrics.html">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="namespace.html">Namespace</a></li>
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">Dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="preferences.html">Preferences</a></li>
<li class="toctree-l2"><a class="reference internal" href="profile.html">Profile</a></li>
<li class="toctree-l2"><a class="reference internal" href="query.html">Query</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Reports</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="service.html">Service</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="workflow.html">Workflow</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../java-client-api.html"> Java Client API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../javadocs/index.html"> Javadocs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release-notes.html"> 发行说明</a></li>
<li class="toctree-l1"><a class="reference internal" href="../licenses/index.html"> Trademarks, Licenses, and Dependencies</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html"> 术语表</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html"> Index</a></li>
</ul>
</nav>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="reports-http-restful-api">
<span id="http-restful-api-reports"></span><h1>Reports HTTP RESTful API<a class="headerlink" href="#reports-http-restful-api" title="Permalink to this headline">🔗</a></h1>
<div class="topic">
<p class="topic-title first"><strong>Note:</strong></p>
<p>Reports is currently a <strong>beta</strong> feature of CDAP 6.1.1, and is subject to change without notice.</p>
</div>
<div class="section" id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">🔗</a></h2>
<p>Reports provides administrators and developers a way to generate comprehensive report of program runs,
specify filters based on various options such as namespaces, program status and type of program,
within a given time range such as 24 hours or one week or a custom time range. You can also specify the columns
that you would like to include in the generated report.</p>
<p>Reports are backed by the ReportGenerationApp system application, which is a Spark service (named ReportGenerationSpark)
with endpoints to generate, list, view, download, share, save or delete reports.</p>
<p>All methods or endpoints described in this API have a base URL (typically
<code class="docutils literal notranslate"><span class="pre">http://&lt;host&gt;:11015</span></code> or <code class="docutils literal notranslate"><span class="pre">https://&lt;host&gt;:10443</span></code>) that precedes the resource
identifier, as described in the <a class="reference internal" href="introduction.html#http-restful-api-conventions-base-url"><span class="std std-ref">RESTful API Conventions</span></a>.
These methods return a status code, as listed in the <a class="reference internal" href="introduction.html#http-restful-api-status-codes"><span class="std std-ref">RESTful API  Status Codes</span></a>.</p>
</div>
<div class="section" id="reports-http-rest-api">
<h2>Reports HTTP REST API<a class="headerlink" href="#reports-http-rest-api" title="Permalink to this headline">🔗</a></h2>
<div class="section" id="generating-reports">
<h3>Generating Reports<a class="headerlink" href="#generating-reports" title="Permalink to this headline">🔗</a></h3>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST:</span>
<span class="go">/v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports</span>
</pre></div>
</div>
<p>With Request Json provided as part of the request body.</p>
<p>Request Json with explanation of JSON fields.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">{</span>
<span class="go">  &quot;name&quot;:&lt;Name of the report&gt;,</span>
<span class="go">  &quot;start&quot;:&lt;start-time-in-seconds&gt;,</span>
<span class="go">  &quot;end&quot;:&lt;end-time-in-seconds&gt;,</span>

<span class="go">  &quot;fields&quot;:[</span>
<span class="go">     &lt;include-this-field-1-in-report&gt;,</span>
<span class="go">      &lt;...&gt;,</span>
<span class="go">     &lt;include-this-field-N-in-report&gt;</span>
<span class="go">  ],</span>

<span class="go">  &quot;filters&quot;:[</span>
<span class="go">     {</span>
<span class="go">        // value filter</span>
<span class="go">        &quot;fieldName&quot;:&lt;name-of-the-field-to-filter-on&gt;,</span>
<span class="go">        &quot;whitelist&quot;:[</span>
<span class="go">           &lt;acceptable-value-1&gt;,</span>
<span class="go">           &lt;..&gt;</span>
<span class="go">           &lt;acceptable-value-N&gt;</span>
<span class="go">        ]</span>
<span class="go">     },</span>
<span class="go">     {</span>
<span class="go">        // value filter</span>
<span class="go">        &quot;fieldName&quot;:&lt;name-of-the-field-to-filter-on&gt;,</span>
<span class="go">        &quot;blacklist&quot;:[</span>
<span class="go">           &lt;non-acceptable-value-1&gt;,</span>
<span class="go">           &lt;...&gt;</span>
<span class="go">           &lt;non-acceptable-value-N&gt;</span>
<span class="go">        ]</span>
<span class="go">     },</span>
<span class="go">     {</span>
<span class="go">        // range filter</span>
<span class="go">        &quot;fieldName&quot;:&quot;&lt;name-of-the-field-to-filter-on&gt;&quot;,</span>
<span class="go">        &quot;range&quot;:{</span>
<span class="go">           &quot;min&quot;:&lt;minimum-allowed-value&gt;</span>
<span class="go">           &quot;max&quot;:&lt;maximum-allowed-value&gt;</span>
<span class="go">        }</span>
<span class="go">     }</span>
<span class="go">  ],</span>
<span class="go">  &quot;sort&quot;:[</span>
<span class="go">     {</span>
<span class="go">        &quot;order&quot;:&quot;ASCENDING (or) DESCENDING&quot;,</span>
<span class="go">        &quot;fieldName&quot;:&quot;&lt;name-of-the-field-to-sort-by&gt;&quot;</span>
<span class="go">     }</span>
<span class="go">  ]</span>
<span class="go">}</span>
</pre></div>
</div>
<p>Example request Json</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="s2">&quot;Failed, Stopped, Running, Succeeded runs - Jul 23, 2018 00:00am to Jul 24, 2018 21:00pm&quot;</span><span class="p">,</span>
  <span class="nt">&quot;start&quot;</span><span class="p">:</span><span class="mi">1532329200</span><span class="p">,</span>
  <span class="nt">&quot;end&quot;</span><span class="p">:</span><span class="mi">1532491200</span><span class="p">,</span>
  <span class="nt">&quot;fields&quot;</span><span class="p">:[</span>
     <span class="s2">&quot;artifactName&quot;</span><span class="p">,</span>
     <span class="s2">&quot;applicationName&quot;</span><span class="p">,</span>
     <span class="s2">&quot;program&quot;</span><span class="p">,</span>
     <span class="s2">&quot;programType&quot;</span><span class="p">,</span>
     <span class="s2">&quot;namespace&quot;</span><span class="p">,</span>
     <span class="s2">&quot;status&quot;</span><span class="p">,</span>
     <span class="s2">&quot;start&quot;</span><span class="p">,</span>
     <span class="s2">&quot;end&quot;</span>
  <span class="p">],</span>
  <span class="nt">&quot;filters&quot;</span><span class="p">:[</span>
     <span class="p">{</span>
        <span class="nt">&quot;fieldName&quot;</span><span class="p">:</span><span class="s2">&quot;status&quot;</span><span class="p">,</span>
        <span class="nt">&quot;whitelist&quot;</span><span class="p">:[</span>
           <span class="s2">&quot;FAILED&quot;</span><span class="p">,</span>
           <span class="s2">&quot;STOPPED&quot;</span><span class="p">,</span>
           <span class="s2">&quot;RUNNING&quot;</span><span class="p">,</span>
           <span class="s2">&quot;COMPLETED&quot;</span><span class="p">,</span>
           <span class="s2">&quot;KILLED&quot;</span>
        <span class="p">]</span>
     <span class="p">},</span>
     <span class="p">{</span>
        <span class="nt">&quot;fieldName&quot;</span><span class="p">:</span><span class="s2">&quot;namespace&quot;</span><span class="p">,</span>
        <span class="nt">&quot;whitelist&quot;</span><span class="p">:[</span>
           <span class="s2">&quot;default&quot;</span>
        <span class="p">]</span>
     <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p>On submitting this request, the backend asynchronously launches a spark job to process and generate the report.
The immediate response contains the report id.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
   &quot;id&quot;: &lt;report-id&gt;
}
</pre></div>
</div>
<p>You can use this report-id to check the status of the report, if it is running, completed or failed using the <cite>info</cite> endpoint
and download completed reports to get information using <cite>download</cite> endpoint.</p>
<p><strong>Note</strong> : Currently sort cannot be performed on more than one field.</p>
</div>
<div class="section" id="listing-reports">
<h3>Listing Reports<a class="headerlink" href="#listing-reports" title="Permalink to this headline">🔗</a></h3>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET :</span>
<span class="go">/v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Query Param</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>offset</td>
<td>offset to read reports from</td>
</tr>
<tr class="row-odd"><td>limit</td>
<td>limit on the number of reports to return</td>
</tr>
</tbody>
</table>
<p>Response Json with explanation for fields</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">{</span>
<span class="go">  &quot;offset&quot;:&lt;offset&gt;,</span>
<span class="go">  &quot;limit&quot;:&lt;limit&gt;,</span>
<span class="go">  &quot;total&quot;:&lt;total-reports-size-returned&gt;,</span>
<span class="go">  &quot;reports&quot;:[</span>
<span class="go">     {</span>
<span class="go">        &quot;id&quot;:&lt;report-id&gt;,</span>
<span class="go">        &quot;name&quot;:&lt;report-name&gt;,</span>
<span class="go">        &quot;created&quot;:&lt;creation-time-seconds&gt;,</span>
<span class="go">        &quot;expiry&quot;:&lt;report-expiry-time-seconds&gt;,</span>
<span class="go">        &quot;status&quot;:&lt;report-status&gt;</span>
<span class="go">     },</span>
<span class="go">     ...</span>
<span class="go">  ]</span>
<span class="go">}</span>
</pre></div>
</div>
<p>Example Response JSON</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;offset&quot;:0,
  &quot;limit&quot;:20,
  &quot;total&quot;:7,
  &quot;reports&quot;:[
     {
        &quot;id&quot;:&quot;18a782b5-8fd4-11e8-ae71-acde48001122&quot;,
        &quot;name&quot;:&quot;Failed, Succeeded, Running, Stopped runs - Jul 24, 2018 22:29pm to Jul 24, 2018 23:29pm&quot;,
        &quot;created&quot;:1532500174,
        &quot;expiry&quot;:1532672986,
        &quot;status&quot;:&quot;COMPLETED&quot;
     },
     ...
     {
        &quot;id&quot;:&quot;09ec25f4-8fd4-11e8-9d5d-acde48001122&quot;,
        &quot;name&quot;:&quot;Failed, Succeeded, Running, Stopped runs - Jul 24, 2018 22:29pm to Jul 24, 2018 23:29pm&quot;,
        &quot;created&quot;:1532500149,
        &quot;expiry&quot;:1532672965,
        &quot;status&quot;:&quot;COMPLETED&quot;
     }
  ]
}
</pre></div>
</div>
</div>
<div class="section" id="sharing-reports">
<h3>Sharing Reports<a class="headerlink" href="#sharing-reports" title="Permalink to this headline">🔗</a></h3>
<p>On Authentication enabled clusters, reports are isolated by logged-in users who generated the reports,
If you wish, you can generate an encrypted share-id for your report, that can be used by others to access the report.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/&lt;report-id&gt;/share</span>
</pre></div>
</div>
<p>Response JSON:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
   &quot;shareId&quot;:&lt;share-id&gt;
}
</pre></div>
</div>
</div>
<div class="section" id="viewing-report-status">
<h3>Viewing Report Status<a class="headerlink" href="#viewing-report-status" title="Permalink to this headline">🔗</a></h3>
<p>The info endpoint can be used to get the report status and summary for a report.
It can be queried either by providing the report-id or by providing a share-id through query param.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET using Report-Id : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/info?report-id=&lt;report-id&gt;</span>
<span class="go">GET using Share-Id : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/info?share-id=&lt;share-id&gt;</span>
</pre></div>
</div>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;request&quot;:{
     &lt;report-generation-request&gt;
  },
  &quot;summary&quot;:{
     &quot;namespaces&quot;:[
        {
           &quot;namespace&quot;:&quot;&lt;namespace&gt;&quot;,
           &quot;runs&quot;:&lt;runs-in-report-for-the-namespace&gt;
        },
        ...
     ],
     &quot;start&quot;:&lt;start-time-seconds&gt;,
     &quot;end&quot;:&lt;end-time-seconds&gt;,
     &quot;artifacts&quot;:[
        {
           &quot;name&quot;:&lt;artifactName&gt;,
           &quot;version&quot;:&lt;artifactVersion&gt;,
           &quot;scope&quot;:&lt;artifactScope,
           &quot;runs&quot;:&lt;runs-in-report-belonging-to-the-artifact&gt;
        },
        ...
     ],
     &quot;durations&quot;:{
        &quot;min&quot;:&lt;minimum-duration-of-runs-in-seconds&gt;,
        &quot;max&quot;:&lt;max-duration-of-runs-in-seconds&gt;,
        &quot;average&quot;:&lt;average-duration-of-runs-in-seconds&gt;
     },
     &quot;starts&quot;:{
        &quot;oldest&quot;:&lt;earliest-started-program-time&gt;,
        &quot;newest&quot;:&lt;latest-started-program-time&gt;
     },
     &quot;owners&quot;:[
        {
           &quot;user&quot;:&lt;userName&gt;,
           &quot;runs&quot;:&lt;runs-started-by-this-user&gt;
        },
        ...
     ],
     &quot;startMethods&quot;:[
        {
           &quot;method&quot;:&quot;MANUAL/SCHEDULED/TRIGGERED&quot;,
           &quot;runs&quot;:&lt;runs-started-by-this-start-method&gt;
        },
        ...
     ],
     &quot;recordCount&quot;:&lt;total-records-in-report&gt;,
     &quot;creationTimeMillis&quot;:&lt;time-when-report-was-created&gt;,
     &quot;expirationTimeMillis&quot;:&lt;time-when-report-will-be-expired&gt;
  },
  &quot;name&quot;:&lt;name-of-the-report&gt;,
  &quot;created&quot;:&lt;report-creation-time-seconds&gt;,
  &quot;expiry&quot;:&lt;report-expiry-time-seconds&gt;,
  &quot;status&quot;:&lt;report-status&gt;
}
</pre></div>
</div>
<p>For reports that are currently running, the response does not contain a report summary</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;request&quot;:{
     &lt;report-generation-request&gt;
  },
  &quot;name&quot;:&lt;name-of-the-report&gt;,
  &quot;created&quot;:&lt;creation-time&gt;,
  &quot;status&quot;:&quot;RUNNING&quot;
}
</pre></div>
</div>
<p>For failed reports, the response contains the error information.</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;request&quot;:{
     &lt;report-generation-request&gt;
  },
  &quot;error&quot; : &lt;error-message&gt;,
  &quot;name&quot;:&lt;name-of-the-report&gt;,
  &quot;created&quot;:&lt;creation-time&gt;,
  &quot;status&quot;:&quot;FAILED&quot;
}
</pre></div>
</div>
</div>
<div class="section" id="downloading-report-contents">
<h3>Downloading Report contents<a class="headerlink" href="#downloading-report-contents" title="Permalink to this headline">🔗</a></h3>
<p>The download endpoint can be used to download the report contents.
You can either provide a report id or a share id through a query parameter.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET using report-id : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/download?report-id=&lt;report-id&gt;</span>
<span class="go">GET using share-id : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/download?share-id=&lt;share-id&gt;</span>
</pre></div>
</div>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;offset&quot;:&lt;offset&gt;,
  &quot;limit&quot;:&lt;limit-of-records-to-return&gt;,
  &quot;total&quot;:&lt;total-number-of-records-in-report&gt;,
  &quot;details&quot;:[
     {
        &quot;field1&quot;:&lt;value&gt;,
        ...
        &quot;fieldN&quot;:&lt;value&gt;
     },
   ...
  ]
}
</pre></div>
</div>
<p>Example JSON response</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;offset&quot;:0,
  &quot;limit&quot;:20,
  &quot;total&quot;:25,
  &quot;details&quot;:[
     {
        &quot;duration&quot;:21,
        &quot;program&quot;:&quot;DataPipelineWorkflow&quot;,
        &quot;programType&quot;:&quot;Workflow&quot;,
        &quot;applicationName&quot;:&quot;testPipeline&quot;,
        &quot;artifactName&quot;:&quot;cdap-data-pipeline&quot;,
        &quot;status&quot;:&quot;COMPLETED&quot;,
        &quot;end&quot;:1532499023,
        &quot;start&quot;:1532499002,
        &quot;namespace&quot;:&quot;default&quot;
     },
     ...
  ]
}
</pre></div>
</div>
</div>
<div class="section" id="saving-reports">
<h3>Saving Reports<a class="headerlink" href="#saving-reports" title="Permalink to this headline">🔗</a></h3>
<p>By default reports expire after 2 weeks, however they can be saved by using the following REST endpoint,</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/&lt;report-id&gt;/save</span>
</pre></div>
</div>
<p>with request body containing the name and description for saving the report</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
  &quot;name&quot; : &lt;report-name&gt;,
  &quot;description&quot; : &lt;description-for-report&gt;
}
</pre></div>
</div>
</div>
<div class="section" id="deleting-reports">
<h3>Deleting Reports<a class="headerlink" href="#deleting-reports" title="Permalink to this headline">🔗</a></h3>
<p>Unneeded reports (whether generated or failed) can be deleted by making a call to the following endpoint</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE : /v3/namespaces/system/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/&lt;report-id&gt;</span>
</pre></div>
</div>
</div>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="Query HTTP RESTful API" href="query.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="Security HTTP RESTful API" href="security.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../_static/js/js.cookie.js"></script><script type="text/javascript" src="../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>